package com.ktjy.ch15.mapper;

import com.ktjy.ch15.entity.Flower;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FlowerMapper {
    /**
     * 查重
     * @param flowerName
     * @return
     */
    public Flower getByFlowerName(String flowerName);

    /**
     * 分页查询
     * @param flower
     * @param pageBegin
     * @param pageSize
     * @return
     */
    public List<Flower> getPage(@Param("flower") Flower flower,
                                @Param("pageBegin") Integer pageBegin,
                                @Param("pageSize") Integer pageSize);

    /**
     * 详情
     * @param flowerId
     * @return
     */
    public Flower getById(@Param("flowerId") Integer flowerId);

    /**
     * 总数
     * @param flower
     * @return
     */
    public Integer count(@Param("flower") Flower flower);

    /**
     * 新增
     * @param flower
     * @return
     */
    public int insert(Flower flower);

    /**
     * 修改
     * @param flower
     * @return
     */
    public int update(Flower flower);

    /**
     * 删除
     * @param flowerId
     * @return
     */
    public int delete(@Param("flowerId") Integer flowerId);

    /**
     * 查重
     * @param flowerName
     * @return
     */
    public Flower findByFlowerName(@Param("flowerName") String flowerName);

}
